package com.allwees.bs.module.oms.rest;

import com.allwees.bs.core.modelbase.branch.BranchUser;
import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.bs.module.oms.req.RetailerCancelShippedReq;
import com.allwees.bs.module.oms.req.RetailerShippedReq;
import com.allwees.bs.module.oms.service.RetailerOmsOrderItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 零售商 oms order item api
 *
 * @author mouhaining
 * @since 2020-03-02 13:53
 */
@Slf4j
@RestController
@RequestMapping("/backstage/api/oms/oms_order_item/retailer")
public class RetailerOmsOrderItemApi extends BaseOmsOrderItemApi<RetailerOmsOrderItemService> {

    /**
     * 发货
     * @return
     */
    @PostMapping("/do_shipped")
    public R doShipped(@RequestBody RetailerShippedReq req) {
        boService.doShipped(req);
        return R.ok();
    }


    @PostMapping("/do_cancel_shipped")
    public R doCancelShipped(@RequestBody RetailerCancelShippedReq req) {
        BranchUser user = getCurrentUser();
        boService.doCancelShipped(req,user.getRetailerUuid());
        return R.ok();
    }
}
